import request from '@/utils/request'

// 获取面试文章列表
export const getAddList = params => {
  return request({
    method: 'GET',
    url: '/articles',
    params
  })
}

// 文章添加
export const additionList = data => {
  return request({
    method: 'POST',
    url: '/articles',
    data
  })
}

// 文章详情
export const getdetailList = pageId => {
  return request({
    method: 'GET',
    url: `/articles/${pageId}`
  })
}

// 删除文章
export const deleteList = bodyId => {
  return request({
    method: 'DELETE',
    url: `/articles/${bodyId}`
  })
}

// 文章编辑
export const compileList = (data) => {
  return request({
    method: 'PUT',
    url: `/articles/${data.id}`,
    data
  })
}

// 文章状态
export const statusList = (id, state) => {
  return request({
    method: 'POST',
    url: `/articles/${id}/${state}`
  })
}
